package be.rubengerits.bluetooth.tester.bluetooth;
import android.bluetooth.*;
import org.apache.http.impl.io.*;

public class BluetoothHandlerFactory {

	public static BluetoothHandler getInstance(BluetoothSocket socket, Class<?> className) throws Exception {
		BluetoothHandler handler = null;
		try {
			Class handlerClass = Class.forName(className.getSimpleName() + BluetoothHandler.class.getSimpleName());
			handler = (BluetoothHandler) handlerClass.newInstance();
		} catch (ClassNotFoundException e) {
			throw e;
		} catch (IllegalAccessException e) {
			throw e;
		} catch (InstantiationException e) {
			throw e;
		}
	
		return handler;
	}
	
}
